﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using DX_DailyUtil_1._0._1.SerRef_WCF_Hitch;

namespace DX_DailyUtil_1._0._1.ks.ctrl.convert
{
    public class Converter_State_Choose : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            
            // null 的话直接赋值未选择
            long _val = value != null ? (long)value : 5;
            String _str = (String)parameter;
            bool _b = false;
            if (_val == 4)
                _b = "check".Equals(_str) ? true : false;
            else
                _b = "check".Equals(_str) ? false : true;
            return _b;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            long strValue = (bool)value ? 4 : 5;
            return strValue;
        }
    }
}
